﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace ChannelVN.Cached.Entity
{
    [DataContract]
    public class ControlSetting
    {
        [DataMember]
        public string CacheClientName { get; set; }
        [DataMember]
        public ControlSettingItem[] ControlSettingItems { get; set; }

        public ControlSettingItem this[string cacheName]
        {
            get
            {
                var count = ControlSettingItems.Length;
                for (var i = 0; i < count; i++)
                {
                    if (cacheName == ControlSettingItems[i].Name)
                    {
                        return ControlSettingItems[i];
                    }
                }
                return null;
            }
        }
    }
}
